import request from '@/utils/request'

const squareRobotApi = {
    /**
     * 智能体广场列表
     */
    lists(params: {
        page_no?: number;
        page_size?: number;
        robot?: string;
        user?: string;
        cate_id?: number;
        is_enable?: number;
        audit_status?: number;
        start_time?: string;
        end_time?: string;
    }): Promise<any> {
        return request.get({
            url: '/square/robot/lists',
            params
        })
    },

    /**
     * 智能体广场审核
     */
    audit(params: {
        id: number;
        audit_status: number;
        audit_result?: string;
    }): Promise<any> {
        return request.post({
            url: '/square/robot/audit',
            params
        })
    },

    /**
     * 智能体广场编辑
     */
    edit(params: {
        id: number;
        cate_id: number;
        sort: number;
        is_enable: number;
    }): Promise<any> {
        return request.post({
            url: '/square/robot/edit',
            params
        })
    },

    /**
     * 智能体广场删除
     */
    delete(id: number, reason?: string): Promise<any> {
        return request.post({
            url: '/square/robot/delete',
            params: {
                id,
                reason
            }
        })
    },

    /**
     * 智能体广场禁用
     */
    disable(id: number, reason?: string): Promise<any> {
        return request.post({
            url: '/square/robot/disable',
            params: {
                id: id,
                reason: reason
            }
        })
    }
}

export default squareRobotApi
